!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>6.12</title>
	<script src="js/vue.js"></script>
	</head>
	<style>
		#app{
			width: 600px;
			margin: 40px auto;
		}
		button {
			margin_top: 15px;
		}
	</style>
	<body>
		<div id="app">
			<h2>信息统计</h2>
			<form>
				<label>
					性别：
					<my-radio name="gender" value="0">男</my-radio>
					<my-radio name="gender" value="1">女</my-radio>
				</label>
				<div>
					<button>提交</button>
				</div>
			</form>
		</div>
	</body>
	<script type="text/x-template" id="my-radio">
		<label>
			<input type="radio" :name="name" :value="value">
			<slot></slot>
		</label>
	</script>
	<script>
		Vue.component('my-radio',{
			template:'#my-radio',
			props: ['name','value']
		})
		
		let vm = new Vue({
			el: '#app'
		})
	</script>
</html>